<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> 

<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>开发工具</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  </head> 
  <body>
  
  <div class="container" style="margin-top:20px;">
		<form action="${ctx }/dev/testReturnSave" method="post">
			<input type="hidden" name="id" value="${testReturn.id }">
			<div class="form-group">
				<label for="exampleInputEmail1">创建者</label> <input
					type="text" class="form-control"
					name="owner" id="owner" value="${testReturn.owner }">
			</div>
			
			<div class="form-group">
				<label for="exampleInputEmail1">标题</label> <input
					type="text" class="form-control" id="title"
					name="title" value="${testReturn.title}">
			</div>
			<div class="form-group">
				<label for="exampleInputPassword1">返回内容</label>
				<textarea class="form-control" rows="10" id="content" name="content">${testReturn.content }</textarea>

			</div>
			<div class="form-group">
				<label for="exampleInputFile">备注</label>
				<textarea class="form-control" rows="5" name="remark">${testReturn.remark}</textarea>
			</div>
			<button type="submit" class="btn btn-primary">保存</button>
			&nbsp;&nbsp;<span style="color:green">${msg }</span>
		</form>
	</div>
  
  <script>
    
    if ("${testReturn.id}" == "") {
	  	var str = document.cookie.split('; ');
		for (var i in str) {
			var n = str[i].split('=')[0];
			var v = str[i].split('=')[1];
			if (n == 'dev_owner') {
				$('#owner').val(v);
			}
		}
    }
    
    try {
		var content = $('#content').text();
		var jsObj = JSON.parse(content);
		var content2 = JSON.stringify(jsObj, null, 4); 
		$('#content').text(content2);
    } catch (e) {
    }
  </script>
  </body>
</html>
